using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Resources;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
using KPIS.GERP.Models.Class;

namespace KPIS.GERP.Models.ICM
{
	[DataContract, Table("IcmPrePurchaseRequestItem")]
    public class PrePurchaseRequestItem
    {

		[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
		[DataMember, Display(Name = "PprItemId", ResourceType = typeof(Resources.PrePurchaseRequestItemResource))]
        public int PprItemId { get; set; }

        [CustomRequired]
        [ForeignKey("PrePurchaseRequest")]
        [DataMember, Display(Name = "PprId", ResourceType = typeof(Resources.PrePurchaseRequestItemResource))]
        public int PprId { get; set; }

        [ForeignKey("ProjectOperationExpense")]
        [DataMember, Display(Name = "ProjOperExpId", ResourceType = typeof(Resources.PrePurchaseRequestItemResource))]
        public int? ProjOperExpId { get; set; }

        [ForeignKey("MasBudgetExpense")]
        [DataMember, Display(Name = "BgExpId", ResourceType = typeof(Resources.PrePurchaseRequestItemResource))]
        public int? BgExpId { get; set; }

        [ForeignKey("MasBudgetSource")]
        [DataMember, Display(Name = "BgSourceId", ResourceType = typeof(Resources.PrePurchaseRequestItemResource))]
        public int? BgSourceId { get; set; }

        [ForeignKey("MasPurchaseRegular")]
        [DataMember, Display(Name = "RegularId", ResourceType = typeof(Resources.PrePurchaseRequestItemResource))]
        public int? RegularId { get; set; }

        [ForeignKey("MasResourceItem")]
		[DataMember, Display(Name = "ResItemId", ResourceType = typeof(Resources.PrePurchaseRequestItemResource))]
        public int? ResItemId { get; set; }

        [ForeignKey("PurchaseRequestItem")]
        [DataMember, Display(Name = "PrItemId", ResourceType = typeof(Resources.PrePurchaseRequestItemResource))]
        public int? PrItemId { get; set; }

		[DataMember, Display(Name = "Descr", ResourceType = typeof(Resources.PrePurchaseRequestItemResource))]
        public string Descr { get; set; }

        [DataMember]
        public bool? HaveItem { get; set; }
        
		[DataMember, Display(Name = "Qty", ResourceType = typeof(Resources.PrePurchaseRequestItemResource))]
        public int? Qty { get; set; }

		[DataMember, Display(Name = "Price", ResourceType = typeof(Resources.PrePurchaseRequestItemResource))]
        public decimal? Price { get; set; }

        [DataMember, Display(Name = "Amount", ResourceType = typeof(Resources.PrePurchaseRequestItemResource))]
        public decimal? Amount { get; set; }

        [DataMember, Display(Name = "StdPrice", ResourceType = typeof(Resources.PrePurchaseRequestItemResource))]
        public decimal? StdPrice { get; set; }


		[DataMember, Display(Name = "CreatedBy", ResourceType = typeof(Resources.PrePurchaseRequestItemResource))]
        public int? CreatedBy { get; set; }

		[DataMember, Display(Name = "CreatedWhen", ResourceType = typeof(Resources.PrePurchaseRequestItemResource))]
        public DateTime? CreatedWhen { get; set; }

		[DataMember, Display(Name = "UpdatedBy", ResourceType = typeof(Resources.PrePurchaseRequestItemResource))]
        public int? UpdatedBy { get; set; }

		[DataMember, Display(Name = "UpdatedWhen", ResourceType = typeof(Resources.PrePurchaseRequestItemResource))]
        public DateTime? UpdatedWhen { get; set; }

        
		[DataMember]
        public virtual BGM.ProjectOperationExpense ProjectOperationExpense { get; set; }

		[DataMember]
        public virtual MasPurchaseRegular MasPurchaseRegular { get; set; }

		[DataMember]
        public virtual MasResourceItem MasResourceItem { get; set; }

		[DataMember]
        public virtual PrePurchaseRequest PrePurchaseRequest { get; set; }

        [DataMember]
        public virtual PurchaseRequestItem PurchaseRequestItem { get; set; }

        [DataMember]
        public virtual BGM.MasBudgetExpense MasBudgetExpense { get; set; }

        [DataMember]
        public virtual BGM.MasBudgetSource MasBudgetSource { get; set; }

    }
}